home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 October / EnigmA AMIGA RUN 22 (1997)(G.R. Edizioni)(IT)[!][issue 1997-10 & 11][EAR-CD VI].iso / earcd / util1 / ffppatch.rdm < prev    next >
Text File  |  1997-07-13  |  6KB  |  205 lines

  1. Short:    Mathffp.library FPU speedup patch 1.3b
  2. Author:   Jess Sosnoski (at the below address!!!)
  3. Uploader: starblaz@postoffice.ptd.net
  4. Version:  1.3beta
  5. Type:     util/boot
  6. Requires: kick 2.04+?, an 020+, and a 68881/2 FPU.
  7.  
  8. Long:
  9.  
  10. FFPpatch 1.3beta © 1997 Jess Sosnoski
  11. Fieee and Tieee functions © 1995 Martin Berndt
  12.  
  13. DESCRIPTION:
  14. -----------
  15. This is a program that patches some functions of the mathffp.library
  16. to use 68881/2 instructions, thus squeezing out a bit more speed.
  17. (I hope!)
  18.  
  19. This is also the first speedup patch I ever attempted to write! :)
  20.  
  21. Works on an '040 or '060 too!
  22. (does not use any FPU trig functions)
  23.  
  24. DISCLAIMER:
  25. ----------
  26. Use this program at your own risk!
  27. I assume no responsibility or liability for problem(s) and/or damage(s)
  28. that occur by the use, modification, and/or existence of this product,
  29. and/or its parts in any form.
  30.  
  31.  But if it don't work right, or slows things down, don't be afraid
  32.  to send me email...or even send some email if it makes your system
  33.  outprocess a cray (yeah, right)
  34.  
  35. Anywayz tho...the following functions are patched, and here's the
  36. speed differences I got with a test program I wrote:
  37.  
  38. *NOTE* The test program must call float() a lot, because when I re-enabled
  39. the SPFloat() patch, the test program ran one hell of a lot faster.
  40.  
  41. I've included the results before I re-enabled the float() patch so you
  42. can see what differences there were.
  43.  
  44. Function    PATCHED        PATCHEDnofloat    Not_Patched  
  45. -----------------------------------------------------------
  46. SPAbs        3.01        12.02        12.02      
  47. SPNeg        2.96        12.19        12.20
  48. SPAdd        7.76        16.57        18.91
  49. SPSub         7.76        16.56        17.78
  50. SPMul        7.56        15.56        20.70
  51. SPDiv        7.58        16.59        20.96
  52. SPFloat        2.94        11.94        11.94
  53. SPFloor        6.11        15.13        15.13
  54.  
  55. Hmmm....very interesting.....that's why this patch is a beta :)
  56.  
  57. Your results will likely differ.
  58. (The testprogram isn't the best in the world)
  59.  
  60. INSTALLATION:
  61. ------------
  62. Copy it to your c: directory or wherever you like.
  63. You can add the line run <>NIL: ffppatch to your startup-sequence, or
  64. user-startup.  You can give it an icon and put it in WBstartup.
  65. You can basically put it anywhere :)
  66. (I have mine a little after setpatch in my startup-sequence)
  67.  
  68. USAGE:
  69. -----
  70. run <>NIL: ffppatch
  71.  
  72. OUTPUT:
  73. ------
  74. None...as I didn't feel like figuring out how to to text output
  75. in assembly.
  76. Although, if you don't have the right versions of the required libraries,
  77. it will exit with a returncode of 20.
  78.  
  79. REMOVAL:
  80. -------
  81. sorry....once it's in...it stays in!
  82. (didn't I hear Al Bundy say that to Peg once...hmmm....)
  83.  
  84. CAVEATS:
  85. -------
  86. This patch is experimental, so, don't expect any miracles.
  87.  
  88. Opens mathffp.library, and never closes it.
  89.  
  90. Also...not a whole hell of a lot of programs use mathffp.library, but those
  91. which do may benefit from a little speedup.
  92. (although some garshneblankers, the akJFIF, akLJPG, and akPNG
  93.  datatypes use it)
  94.  
  95. There exists a 68881 card for 68000 owners, but, as I found out via
  96. email, does not access the FPU in the same way that an 020+ would.
  97. I did not include any special code to support this, so it is likely that
  98. this patch may not do anything at all on that type of setup.
  99. (Although, if someone would like to let me know if it does...email me!)
  100.  
  101. NOTES:
  102. -----
  103. mathffp.library is in your Kickstart ROM...you won't find it in libs.
  104.  
  105. FFPTEST
  106. -------
  107. Here it is!   Just type ffptest and it will dump out the results.
  108. It disables multitasking while running.  It does actually give results
  109. with an 040 or 060.  (though the numbers are quite small)
  110.  
  111. The best thing you can do is go into the bootshell, with 
  112. ALL CPU CACHES OFF--leaving them on can give different results with or
  113. without ffppatch when run multiple times (I found this out the hard way)
  114. (trust me, you WILL see a difference)
  115. Note: the testprogram is written in PCQ pascal and may be a bit dodgy.
  116.  
  117.  
  118. cpu NOCACHE    
  119. ffptest
  120.  
  121. run <>NIL: ffppatch
  122. ffptest
  123.  
  124. Then you will see a difference.
  125.  
  126. HISTORY:
  127. -------
  128. 1.0     First Release
  129.  
  130. 1.1    Now closes mathffp.library when mathtrans.lib v40 can't be opened
  131.     Optimized spmul, spdiv, spabs, spneg, spflt, spfloor and squeezed
  132.     a couple more clock cycles out.
  133.     (spadd and spsub optimized too, but disabled cuz they were
  134.      slower for some reason :( )
  135.     Removed SPFix patch...it was slower :(
  136. 1.2    Due to my rewriting of ffptest (included), I was able to more
  137.     accurately test speed of calls to mathffp.library.  
  138.     I found out everything went faster in the first place :)
  139.     Re-enabled everything.
  140.  
  141. 1.3    Contacted Martin Berndt, author of fmath40x.lha, and asked
  142.     about the Fieee and Tieee functions....so, he emailed me the
  143.     source...and I removed the mathtrans.library requirement and
  144.     put the functions directly into the patch program, making it
  145.     faster :)
  146.  
  147.     
  148. FUTURE:
  149. ------
  150. Make this doc file a bit more presentable, and maybe leave it as plain
  151. text without Amigaguide OR HTML just for kicks.
  152. Write a more accurate test program, and maybe include it in the archive.
  153.  
  154. Make a GOOD ffptest speedtest program. (in assembly)
  155.  
  156. Maybe add command line-arguments to turn on/off selected patches.
  157.  
  158. Make the patch exit, instead of hanging around.
  159.  
  160. One word: APATCH (if this patch turns out to work as I'd like it to)
  161.  
  162. THANKS TO:
  163. ---------
  164. Martin Berndt...for sending me the sourcecode to Tieee and Fieee
  165. functions from his fmath40x mathtrans.library.
  166.  
  167. Adam "DC1" Polosnik for ideas, help with sourcecode, and APATCH!
  168.  
  169. Dave "Termy" Jones, for help, ideas and StreamLineOS 2!
  170.  
  171. Everyone who sent me emails, praise, and complaints....your input
  172. was greatly appreciated!!!!
  173.  
  174. BUGS:
  175. ----
  176. Hmmm...what would Tom say, ohyeah, um....possibly.
  177. Crummy speedtest program.
  178.  
  179. AUTHOR:
  180. ------
  181. Jess Sosnoski
  182. 651 Hillside Drive
  183. Mount Carmel, PA 17851-2463
  184. USA
  185.  
  186. starblaz@postoffice.ptd.net
  187. http://home.ptd.net/~starblaz
  188.  
  189. IRC nick: starblaz
  190. On: galaxynet (#amichat), beyondirc (#styx, #amirc), dalnet (#nin ,#c-64)
  191.  
  192. Emails, gifts, money, food, cigarettes, Amiga4060T's will all be
  193. gladly accepted.
  194.  
  195.  
  196. ============================= Archive contents =============================
  197.  
  198. Original  Packed Ratio    Date     Time    Name
  199. -------- ------- ----- --------- --------  -------------
  200.      564     398 29.4% 28-Jun-97 21:02:34  ffppatch
  201.     5908    2979 49.5% 28-Jun-97 21:07:10  ffppatch.readme
  202.     7056    3673 47.9% 28-Jun-97 21:07:36  ffptest
  203. -------- ------- ----- --------- --------
  204.    13528    7050 47.8% 29-Jun-97 19:19:40   3 files
  205.